<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVoteGroupsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('vote_groups', function (Blueprint $table) {
            $table->uuid('id')->unique();
            $table->uuid('activity_id');
            $table->integer('order_id');
            $table->integer('type'); // 分组的类型  1、投票  2、竞猜
            $table->string('title');
            $table->string('memo')->nullable();

            $table->timestamps();
            $table->softDeletes();

            $table->index('activity_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('vote_groups');
    }
}
